import argparse


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        'action',
        choices=['process', 'train', 'predict', 'evaluate', 'serve']
    )
    args = parser.parse_args()

    if args.action == 'process':
        from preprocess.process import process_data

        process_data()

    elif args.action == 'train':
        from runner.train import train

        train()

    elif args.action == 'predict':
        from runner.predict import run_predict

        run_predict()

    elif args.action == 'evaluate':
        from runner.evaluate import run_evaluate

        run_evaluate()

    elif args.action == 'serve':
        from web.app import run_app

        run_app()

    else:
        print('action not recognized')


if __name__ == '__main__':
    main()
